<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>linux小操作 | 静待花开</title><meta name="author" content="brad 随风起舞"><meta name="copyright" content="brad 随风起舞"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="基于centOS7的系统如果没有ifconfig命令 echo $PATH 命令查找当前用户的环境变量路径配置  检查Sbin目录下有没有ifconfig命令  没有.通过yum search ifconfig 搜索改命令所在的包  找到后.yum install net-tools.x86_64 就能安装下载   查看内核版本uname -a  查看系统的安装包rpm -qa | grep ja">
<meta property="og:type" content="article">
<meta property="og:title" content="linux小操作">
<meta property="og:url" content="https://zhangbo4881820.gitee.io/myblog/posts/53162/index.html">
<meta property="og:site_name" content="静待花开">
<meta property="og:description" content="基于centOS7的系统如果没有ifconfig命令 echo $PATH 命令查找当前用户的环境变量路径配置  检查Sbin目录下有没有ifconfig命令  没有.通过yum search ifconfig 搜索改命令所在的包  找到后.yum install net-tools.x86_64 就能安装下载   查看内核版本uname -a  查看系统的安装包rpm -qa | grep ja">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png">
<meta property="article:published_time" content="2019-12-13T03:47:35.000Z">
<meta property="article:modified_time" content="2023-09-07T09:44:01.905Z">
<meta property="article:author" content="brad 随风起舞">
<meta property="article:tag" content="小操作">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png"><link rel="shortcut icon" href="/myblog/img/favicon.png"><link rel="canonical" href="https://zhangbo4881820.gitee.io/myblog/posts/53162/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/myblog/css/index.css"><link rel="stylesheet" href="/myblog/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="/myblog/css/fancybox.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
  root: '/myblog/',
  algolia: undefined,
  localSearch: {"path":"/myblog/search.xml","preload":false,"top_n_per_article":1,"unescape":false,"languages":{"hits_empty":"找不到您查询的内容：${query}","hits_stats":"共找到 ${hits} 篇文章"}},
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  dateSuffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  },
  autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'linux小操作',
  isPost: true,
  isHome: false,
  isHighlightShrink: true,
  isToc: true,
  postUpdate: '2023-09-07 17:44:01'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = (url,id = false) => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      if (id) link.id = id
      link.onerror = reject
      link.onload = link.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        link.onload = link.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 7.0.0-rc2"><link rel="alternate" href="/myblog/atom.xml" title="静待花开" type="application/atom+xml">
</head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/myblog/archives/"><div class="headline">文章</div><div class="length-num">57</div></a><a href="/myblog/tags/"><div class="headline">标签</div><div class="length-num">20</div></a><a href="/myblog/categories/"><div class="headline">分类</div><div class="length-num">25</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/myblog/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 分享</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/myblog/Gallery/"><i class="fa-fw fas fa-images"></i><span> 照片</span></a></li><li><a class="site-page child" href="/myblog/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/myblog/movies/"><i class="fa-fw fas fa-video"></i><span> 视频</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/myblog/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="not-top-img" id="page-header"><nav id="nav"><span id="blog-info"><a href="/myblog/" title="静待花开"><span class="site-name">静待花开</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/myblog/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> 分享</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/myblog/Gallery/"><i class="fa-fw fas fa-images"></i><span> 照片</span></a></li><li><a class="site-page child" href="/myblog/music/"><i class="fa-fw fas fa-music"></i><span> 音乐</span></a></li><li><a class="site-page child" href="/myblog/movies/"><i class="fa-fw fas fa-video"></i><span> 视频</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/myblog/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/myblog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav></header><main class="layout" id="content-inner"><div id="post"><div id="post-info"><h1 class="post-title">linux小操作</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2019-12-13T03:47:35.000Z" title="发表于 2019-12-13 11:47:35">2019-12-13</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2023-09-07T09:44:01.905Z" title="更新于 2023-09-07 17:44:01">2023-09-07</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/myblog/categories/linux/">linux</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="linux小操作"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div><article class="post-content" id="article-container"><h1 id="基于centOS7的系统"><a href="#基于centOS7的系统" class="headerlink" title="基于centOS7的系统"></a>基于centOS7的系统</h1><h2 id="如果没有ifconfig命令"><a href="#如果没有ifconfig命令" class="headerlink" title="如果没有ifconfig命令"></a>如果没有ifconfig命令</h2><ol>
<li><p><code>echo $PATH</code> 命令查找当前用户的环境变量路径配置</p>
</li>
<li><p>检查Sbin目录下有没有ifconfig命令</p>
</li>
<li><p>没有.通过<code>yum search ifconfig</code> 搜索改命令所在的包</p>
</li>
<li><p>找到后.<code>yum install net-tools.x86_64</code> 就能安装下载</p>
</li>
</ol>
<h2 id="查看内核版本"><a href="#查看内核版本" class="headerlink" title="查看内核版本"></a>查看内核版本</h2><pre><code>uname -a
</code></pre>
<h2 id="查看系统的安装包"><a href="#查看系统的安装包" class="headerlink" title="查看系统的安装包"></a>查看系统的安装包</h2><pre><code>rpm -qa | grep java(包)
</code></pre>
<h2 id="完整删包命令"><a href="#完整删包命令" class="headerlink" title="完整删包命令"></a>完整删包命令</h2><pre><code>rpm -e --nodeps (包)
</code></pre>
<p>–nodeps  不验证套件档的相互关联性</p>
<h1 id="安装docker"><a href="#安装docker" class="headerlink" title="安装docker"></a>安装docker</h1><ol>
<li><p>yum 更新</p>
<pre><code> yum update
</code></pre>
</li>
<li><p>安装依赖软件<br>yum-util 提供 yum-config-manager 功能，另外两个是 devicemapper 驱动依赖的</p>
<pre><code> yum install -y yum-utils device-mapper-persistent-data lvm2
</code></pre>
</li>
<li><p>设置yum源(任选一个.)</p>
<pre><code> yum-config-manager --add-repo http://download.docker.com/linux/centos/docker-ce.repo（中央仓库）

 yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo（阿里仓库 )
</code></pre>
</li>
<li><p>查看所有仓库中所有 docker 版本</p>
<pre><code>  yum list docker-ce --showduplicates | sort -r
</code></pre>
</li>
<li><p>安装 Docker,我选的是 docker-ce-18.03.1.ce</p>
<pre><code> yum install docker-ce-18.03.1.ce
</code></pre>
</li>
<li><p>启动 Docker,然后加入开机启动</p>
<pre><code> systemctl start docker
 systemctl enable docker
</code></pre>
</li>
<li><p>更多docker命令</p>
</li>
</ol>
<p>请到<a href="../431/">docke小操作</a>文章</p>
<h1 id="安装JDK"><a href="#安装JDK" class="headerlink" title="安装JDK"></a>安装JDK</h1><ol>
<li><p>下载JDK<a href="https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">官网</a></p>
</li>
<li><p>放入 &#x2F;usr&#x2F;local&#x2F;java 下</p>
<pre><code> cp jdk-8u144-linux-x64.tar.gz /usr/local/src/
</code></pre>
</li>
<li><p>解压</p>
<pre><code> tar -zxvf jdk-8u144-linux-x64.tar.gz
</code></pre>
</li>
<li><p>删除 JDK 压缩包</p>
<pre><code> rm -f jdk-8u144-linux-x64.tar.gz
</code></pre>
</li>
<li><p>配置环境变量</p>
<pre><code> vim /etc/profile
</code></pre>
</li>
</ol>
<p>键入如下内容:</p>
<pre><code>    export JAVA_HOME=/usr/local/java/jdk1.8.0_231
    export CLASSPATH=.:$&#123;JAVA_HOME&#125;/jre/lib/rt.jar:$&#123;JAVA_HOME&#125;/lib/dt.jar:$&#123;JAVA_HOME&#125;/lib/tools.jar
    export PATH=$PATH:$&#123;JAVA_HOME&#125;/bin
</code></pre>
<ol start="6">
<li><p>让配置的环境变量生效</p>
<pre><code> source /etc/profile
</code></pre>
</li>
</ol>
<h1 id="安装tomcat"><a href="#安装tomcat" class="headerlink" title="安装tomcat"></a>安装tomcat</h1><p>一样的下载解压:主要讲配置环境变量开机启动:</p>
<ol>
<li><p>配置启动环境:</p>
<pre><code> vi /etc/profile.d/tomcat9.sh
 export CATALINA_HOME=/usr/local/tomcat/tomcat9
 export PATH=$TOMCAT_HOME/bin:$PATH
 source /etc/profile.d/tomcat9.sh
</code></pre>
</li>
<li><p>配置成服务,自动启动</p>
<pre><code> cd /usr/lib/systemd/system
 vim tomcat9.service
</code></pre>
</li>
</ol>
<p>输入如下内容:</p>
<pre><code>    [Unit]
    Description=Tomcat
    After=syslog.target network.target remote-fs.target nss-lookup.target
      
    [Service]
    Type=oneshot
    ExecStart=/usr/local/tomcat/tomcat9/bin/startup.sh
    ExecStop=/usr/local/tomcat/tomcat9/bin/shutdown.sh
    ExecReload=/bin/kill -s HUP $MAINPID
    RemainAfterExit=yes
      
    [Install]
    WantedBy=multi-user.target
</code></pre>
<p>执行如下命令,使得tomcat9开机启动:</p>
<pre><code>    systemctl enable tomcat9.service
</code></pre>
<p>其他命令: </p>
<pre><code>    systemctl start tomcat9.service    启动tomcat

    systemctl stop tomcat9.service    关闭tomcat   

    systemctl restart tomcat9.service    重启tomcat
</code></pre>
<ol start="3">
<li><p>注意centos7默认防火墙是firewalld没有开放8080,如下操作</p>
<pre><code> 输入命令：
 firewall-cmd --zone=public --add-port=8080/tcp --permanent
 重启防火墙:
 firewall-cmd --reload
</code></pre>
</li>
<li><p>注意配置管理用户的时候如下操作<br>在tomcat安装目录的webapps&#x2F;manager&#x2F;META-INFO目录下的context.xml文件里context标签里的内容注释掉,然后在去配置tomcat-users.xml文件的用户角色</p>
</li>
</ol>
<h1 id="安装mysql8"><a href="#安装mysql8" class="headerlink" title="安装mysql8"></a>安装mysql8</h1><ol>
<li><p>查看是否有安装过 mysql</p>
<pre><code> rpm -qa | grep -i mysql
 根据软件包查看安装路径
 rpm -ql 软件名称
</code></pre>
</li>
<li><p>删除 mysql(yum能完全删除干净)</p>
<pre><code> yum -y remove MySQL-*
 //如果是tar安装的
 make uninstall 软件名
 // rpm 包安装的软件
 rpm -e 软件名
</code></pre>
</li>
<li><p>把所有出现的目录统统删除</p>
<pre><code> find / -name mysql
</code></pre>
</li>
<li><p>删除配置文件</p>
<pre><code> rm -rf /etc/my.cnf
</code></pre>
</li>
<li><p>删除 mysql 的默认密码</p>
<pre><code> rm -rf /root/.mysql_sercret
</code></pre>
</li>
</ol>
<p>五步完成之后，这样 mysql 就全部删除干净了，若没安装过 mysql 可忽略以上步骤</p>
<h2 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h2><ol>
<li><p>配置 Mysql 8.0 安装源</p>
<pre><code> rpm -Uvh https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
</code></pre>
</li>
<li><p>安装 Mysql 8.0</p>
<pre><code> yum --enablerepo=mysql80-community install mysql-community-server
</code></pre>
</li>
<li><p>启动 mysql 服务</p>
<pre><code> systemctl start mysqld.service
 //查看状态
 systemctl status mysqld.service
 systemctl stop mysqld.service
</code></pre>
</li>
<li><p>查看 root 临时密码</p>
<pre><code> grep &quot;A temporary password&quot; /var/log/mysqld.log
</code></pre>
</li>
<li><p>更改临时密码</p>
<pre><code> alter user &#39;root&#39;@&#39;localhost&#39; identified by &#39;新密码&#39;;
</code></pre>
</li>
<li><p>当前的密码验证策略</p>
<pre><code> SHOW VARIABLES LIKE &#39;validate_password.%&#39;;
</code></pre>
</li>
<li><p>更改策略</p>
<pre><code> set global validate_password.length=6;
 等等
</code></pre>
</li>
<li><p>配置远程访问</p>
<pre><code> GRANT ALL PRIVILEGES ON *.* TO &#39;root&#39;@&#39;localhost&#39;
</code></pre>
</li>
<li><p>如果没有%号下的root用户</p>
<pre><code> //查看当前用户
 use mysql;
 select host, user, authentication_string, plugin from user;
 发现 root 的 host 是 localhost，不是 %，可以加个 host 是 % 的 root 账号：
 CREATE USER &#39;root&#39;@&#39;%&#39; IDENTIFIED BY &#39;KC$abc123&#39;;
</code></pre>
</li>
<li><p>客户端连接报错<br>原因是 mysql8 的加密方式规则不一样，是 caching_sha2_password<br>需要加密方式改成 mysql_native_password 就行了</p>
<pre><code>ALTER USER ‘flowable’@’%’ IDENTIFIED WITH mysql_native_password BY ‘flowable’;
</code></pre>
</li>
<li><p>继续报错防火墙开放端口或者关闭防火墙</p>
</li>
<li><p>java程序想要连数据库还要安装mysql连接驱动<br><a href="https://centos.pkgs.org/7/mysql-connectors-x86_64/mysql-connector-java-8.0.16-1.el7.noarch.rpm.html">点击这里下载</a></p>
<pre><code>mysql-connector-java-8.0.16-1.el7.noarch.rpm
</code></pre>
</li>
</ol>
<p>下载好这个安装包,然后执行命令解压.</p>
<pre><code>    yum install mysql-connector-java-8.0.16-1.el7.noarch.rpm
</code></pre>
<p>解压后找到mysql-connector-java.jar包,复制到&#x2F;usr&#x2F;lib&#x2F;jvm&#x2F;jre&#x2F;lib&#x2F;ext&#x2F;目录下. </p>
<h1 id="配置Linux静态IP"><a href="#配置Linux静态IP" class="headerlink" title="配置Linux静态IP"></a>配置Linux静态IP</h1><p>这里讲下Hyper-v的设置过程</p>
<p>虚拟机交换机管理 -&gt; 新建虚拟机网络交换机， 勾选外部网络，如下</p>
<p><img src="/myblog/image/staticipsetup.png"></p>
<p>新建完成后，在 “网络连接”，可以看到刚创建的网络交换机</p>
<p><img src="/myblog/image/network.png"></p>
<p>设置静态 ip， vi &#x2F;etc&#x2F;sysconfig&#x2F;network-scripts&#x2F;ifcfg-eth0, 将 bootproto 设置为 static，onboot 设置为 yes, 添加 ip, 子网掩码，网关和 dns 如下:</p>
<p><img src="/myblog/image/setupstaticip.png"></p>
<p>需要注意的是，网关和 dns，可以通过 cmd 命令行下,   ipconfig&#x2F;all &gt; d:&#x2F;ip.txt  ，然后查看 d 盘下的 ip.txt 文件获取这些信息</p>
<h1 id="linux关闭防火墙"><a href="#linux关闭防火墙" class="headerlink" title="linux关闭防火墙"></a>linux关闭防火墙</h1><pre><code>//临时关闭
systemctl stop firewalld
//禁止开机启动
systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service
</code></pre>
<h1 id="安装telnet服务"><a href="#安装telnet服务" class="headerlink" title="安装telnet服务"></a>安装telnet服务</h1><ol>
<li><p>检查是否安装</p>
<blockquote>
<p>rpm -qa telnet-server<br>rpm -qa xinetd</p>
</blockquote>
</li>
<li><p>如果没有安装过就安装 查找 yum</p>
<blockquote>
<p>yum list |grep telnet<br>yum list |grep xinetd</p>
</blockquote>
</li>
<li><p>执行安装语句</p>
<blockquote>
<p>yum -y install telnet-server.x86_64<br>yum -y install telnet.x86_64<br>yum -y install xinetd.x86_64</p>
</blockquote>
</li>
<li><p>设置开机启动</p>
<blockquote>
<p>systemctl enable xinetd.service<br>systemctl enable telnet.socket</p>
</blockquote>
</li>
<li><p>启动服务</p>
<blockquote>
<p>systemctl start telnet.socket<br>systemctl start xinetd</p>
</blockquote>
</li>
</ol>
<p>docker run -d -i -p 1234:1234 –name daemon ubuntu:14.04 nc -l 1234</p>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="https://zhangbo4881820.gitee.io/myblog">brad 随风起舞</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://zhangbo4881820.gitee.io/myblog/posts/53162/">https://zhangbo4881820.gitee.io/myblog/posts/53162/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://zhangbo4881820.gitee.io/myblog" target="_blank">静待花开</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/myblog/tags/%E5%B0%8F%E6%93%8D%E4%BD%9C/">小操作</a></div><div class="post_share"><div class="social-share" data-image="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/myblog/posts/431/" title="docker小操作"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">docker小操作</div></div></a></div><div class="next-post pull-right"><a href="/myblog/posts/23732/" title="Idea配置tomcat"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">Idea配置tomcat</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/myblog/posts/23732/" title="Idea配置tomcat"><div class="cover" style="background: var(--default-bg-color)"></div><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2019-12-11</div><div class="title">Idea配置tomcat</div></div></a></div><div><a href="/myblog/posts/431/" title="docker小操作"><div class="cover" style="background: var(--default-bg-color)"></div><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2019-12-13</div><div class="title">docker小操作</div></div></a></div><div><a href="/myblog/posts/44091/" title="nginx小操作"><div class="cover" style="background: var(--default-bg-color)"></div><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2019-12-13</div><div class="title">nginx小操作</div></div></a></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://i.loli.net/2021/02/24/5O1day2nriDzjSu.png" onerror="this.onerror=null;this.src='/myblog/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">brad 随风起舞</div><div class="author-info__description">有些事情需要一辈子的沉淀</div></div><div class="card-info-data site-data is-center"><a href="/myblog/archives/"><div class="headline">文章</div><div class="length-num">57</div></a><a href="/myblog/tags/"><div class="headline">标签</div><div class="length-num">20</div></a><a href="/myblog/categories/"><div class="headline">分类</div><div class="length-num">25</div></a></div><a id="card-info-btn" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/xxxxx" target="_blank" title="Github"><i class="fab fa-github" style="color: #24292e;"></i></a><a class="social-icon" href="mailto:xxxxxx@gmail.com" target="_blank" title="Email"><i class="fas fa-envelope" style="color: #4a7dbe;"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%9F%BA%E4%BA%8EcentOS7%E7%9A%84%E7%B3%BB%E7%BB%9F"><span class="toc-number">1.</span> <span class="toc-text">基于centOS7的系统</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%A6%82%E6%9E%9C%E6%B2%A1%E6%9C%89ifconfig%E5%91%BD%E4%BB%A4"><span class="toc-number">1.1.</span> <span class="toc-text">如果没有ifconfig命令</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%9F%A5%E7%9C%8B%E5%86%85%E6%A0%B8%E7%89%88%E6%9C%AC"><span class="toc-number">1.2.</span> <span class="toc-text">查看内核版本</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%9F%A5%E7%9C%8B%E7%B3%BB%E7%BB%9F%E7%9A%84%E5%AE%89%E8%A3%85%E5%8C%85"><span class="toc-number">1.3.</span> <span class="toc-text">查看系统的安装包</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%AE%8C%E6%95%B4%E5%88%A0%E5%8C%85%E5%91%BD%E4%BB%A4"><span class="toc-number">1.4.</span> <span class="toc-text">完整删包命令</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%AE%89%E8%A3%85docker"><span class="toc-number">2.</span> <span class="toc-text">安装docker</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%AE%89%E8%A3%85JDK"><span class="toc-number">3.</span> <span class="toc-text">安装JDK</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%AE%89%E8%A3%85tomcat"><span class="toc-number">4.</span> <span class="toc-text">安装tomcat</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%AE%89%E8%A3%85mysql8"><span class="toc-number">5.</span> <span class="toc-text">安装mysql8</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%AE%89%E8%A3%85"><span class="toc-number">5.1.</span> <span class="toc-text">安装</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E9%85%8D%E7%BD%AELinux%E9%9D%99%E6%80%81IP"><span class="toc-number">6.</span> <span class="toc-text">配置Linux静态IP</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#linux%E5%85%B3%E9%97%AD%E9%98%B2%E7%81%AB%E5%A2%99"><span class="toc-number">7.</span> <span class="toc-text">linux关闭防火墙</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%AE%89%E8%A3%85telnet%E6%9C%8D%E5%8A%A1"><span class="toc-number">8.</span> <span class="toc-text">安装telnet服务</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/myblog/posts/15695/" title="jenkins（1）">jenkins（1）</a><time datetime="2023-09-14T02:17:44.000Z" title="发表于 2023-09-14 10:17:44">2023-09-14</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/myblog/posts/22012/" title="wsl的Ubuntu子系统（1）">wsl的Ubuntu子系统（1）</a><time datetime="2023-09-13T08:42:19.000Z" title="发表于 2023-09-13 16:42:19">2023-09-13</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/myblog/posts/30302/" title="effective-java-(接口优于抽象类)">effective-java-(接口优于抽象类)</a><time datetime="2023-09-12T08:12:48.000Z" title="发表于 2023-09-12 16:12:48">2023-09-12</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/myblog/posts/9473/" title="effective-java(创建和销毁对象--组合的形式优于继承)">effective-java(创建和销毁对象--组合的形式优于继承)</a><time datetime="2023-09-11T08:23:19.000Z" title="发表于 2023-09-11 16:23:19">2023-09-11</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/myblog/posts/16107/" title="Hello World">Hello World</a><time datetime="2023-09-07T09:44:01.910Z" title="发表于 2023-09-07 17:44:01">2023-09-07</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By brad 随风起舞</div><div class="framework-info"><span>框架 </span><a href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/myblog/js/utils.js"></script><script src="/myblog/js/main.js"></script><script src="/myblog/js/fancybox.umd.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div class="no-result" id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/myblog/js/search/local-search.js"></script></div></div></body></html>